<%@page contentType="text/html; charset=UTF-8" %>
<!DOCTYPE html>
<html>
	<head>
		<title>-平台管理</title>
		<meta http-equiv="keywords" content="种子婴儿网">
		<meta http-equiv="description" content="种子婴儿网-后台管理">
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/web_manager/web_manager_all.css">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/web_manager/index.css">
		 
		<script type="text/javascript" charset="UTF-8" src="${pageContext.request.contextPath}/js/jquery-1.7.1.js"></script>
		<script type="text/javascript" charset="UTF-8" src="${pageContext.request.contextPath}/js/admin.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				menuModel() ;
			});
			
			/**
			 *	菜单模块
			 */
			function menuModel() {
				$.post("${pageContext.request.contextPath}/menu?menumodel=m1&d="+new Date(),null,function(data) {
					var jsonVal = eval("{"+data+"}") ;
					if(jsonVal.length > 0) {
						
						var menuModel_ul= $("#menuModel_ul") ;
						
						for(var i=0; i<jsonVal.length; i++) {
							var _li = $("<li>");_li.attr("class","inactive");_li.attr("id","menu"+i);
							var _a = "<a href='#' id='"+jsonVal[i].map.MMID+"'>"+jsonVal[i].map.MMNAME+"</a>" ;
							_li.html(_a) ;
							menuModel_ul.append(_li) ;
						}
						//默认选中
						menuModel_ul.children("li").eq(0).attr("class","active") ;
						menuClick(jsonVal.length) ;
						
						menulist(menuModel_ul.children("li").eq(0).children("a").attr("id")) ;
					}
				});
			}
			function menuClick(len){
				$('#nav').find("a").click(function() {
					for(var i=0;i<len;i++) {
						$("#menu"+i).attr('class', 'inactive');
					}
					$(this).parents("li").attr('class', 'active');
					
					var id = $(this).attr('id');
					menulist(id) ;
				});
			}
			
			/*
			<tr>
		    	<td width="182" valign="top">
			    	<h1><a href="javascript:void(0);" class="MH" lang="1">网站基本管理</a></h1>
			    	<div class="content">
			    		<ul class="menu_ul" id="mlist1">
			    			<li><a href="javascript:void(0);">基本管理1</a></li>
			    			<li><a href="javascript:void(0);">基本管理1</a></li>
			    			<li><a href="javascript:void(0);">基本管理1</a></li>
			    			<li><a href="javascript:void(0);">基本管理1</a></li>
			    		</ul>
			    	</div>
		    	</td>
		   	</tr>
			*/
			function menulist(modelid) {
				$.post("${pageContext.request.contextPath}/menu?menuitem="+modelid+"&d="+new Date(),null,function(data){
					var jsonVal = eval("{"+data+"}");
					
					var index = 1 ;
					
					var menulist = $("#menulist") ;
					menulist.empty();
					
					if(jsonVal.length>0){
						$.each(jsonVal,function(i,p){
							
							if(p.mlIsRoot == "Y") {
								var _tr = $("<tr>") ;
								var _td = $("<td>") ;_td.attr("width","182");_td.attr("valign","top");
								var _h1 = $("<h1>") ;
								var _div = $("<div>") ;_div.attr("class","content") ;
								var _ul = $("<ul>") ;_ul.attr("class","menu_ul");_ul.attr("id","mlist"+index);
								var _a = $("<a>") ;_a.attr("href","javascript:void(0);");_a.attr("class","MH");_a.attr("lang",index);
								_a.text(p.mlName) ;
								
								_h1.html(_a) ;
								
								$.each(jsonVal,function(i,pc){
									if(p.mlId == pc.menuItemFk) {
										var _li = $("<li>") ;
										
										var _child_a = $("<a>") ;
										_child_a.attr("href","javascript:void(0);") ;
										_child_a.text(pc.mlName) ;
										
										_child_a.click(function() {
											openfunbar(pc.mlFunbar) ;
											gotoPageVerify(pc.mlUrl) ;
										});
										
										_li.html(_child_a) ;
										_ul.append(_li) ;
									}
								});
								_div.html(_ul) ;
								_td.append(_h1) ;
								_td.append(_div) ;
								_tr.append(_td) ;
								menulist.append(_tr) ;
								
								index+=index;
								
								_a.click(function(){
									var num = $(this).attr("lang") ;
									var currentUL = $("#mlist"+num) ;
									
									if(currentUL.is(":hidden")) {
										//隐藏所以得UL菜单
										$(".menu_ul").hide();
										//显示当前点击的UL菜单
										currentUL.show();
									}
								}) ;
							}
						});
					}
					$(".menu_ul").eq(0).show();
				});
			}
			
			/** 菜单列表功能子菜单 */
			function openfunbar(funbar) {
				var fbar = $("#fbar") ;
				fbar.empty();
				
				$.each(funbar,function(i,p){
					var fba = $("<a>") ;
					
					fba.attr("hidefocus","hidefocus");
					fba.attr("href","javascript:void(0);");
					fba.attr("class","active_bar");
					fba.html("<span>"+p.name+"<span>") ;
				
					fbar.append(fba) ;
					
					fba.click(function() {
						gotoPageVerify(p.url) ;
					});
				});
				
			}
			
			//进行权限认证
			function gotoPageVerify(urladdr) {
				
				urladdr = urladdr.indexOf("?") == -1?urladdr+"?d="+new Date().getTime():urladdr+"&d="+new Date().getTime();
				window.open(urladdr,"pageframe","");
			}
		</script>
	</head>
	
	<body>
		<div id="index">
			
			<header>
				<div id="header">
					<div class="head_left">LOGO</div>
					<div class="head_right_top">
						<div class="top_welcome">
							您好：孤独的狼 &nbsp;&nbsp;&nbsp;级别：[****] 
						</div> 
						<div class="top_func">
							<ul>
								<!-- 
								<li>
									<iframe src="http://m.weather.com.cn/m/pn4/weather.htm " width="160" height="20" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>
								</li>
								-->
								<li><a href="javascript:void(0);">个人信息</a></li>
								<li><a href="javascript:void(0);">站内信息(100)</a></li>
								<li><a href="javascript:void(0);">收件箱(10)</a></li>
								<li><a href="javascript:void(0);">安全退出</a></li>
							</ul>
						</div>
						<div class="top_func">
						
						</div>
					</div>
					<div class="head_right_bto">
						<div id="nav">
					    	<ul style="margin: 0px;padding:0px;" id="menuModel_ul">
					    		<!-- 
						            <li class="active" id="config"><a href="#">平台首页</a></li>
						        	<li class="inactive" id="other"><a href="#">B2C商城</a></li>
						            <li class="inactive" id="user"><a href="#">DRP进销存</a></li>
						            <li class="inactive" id="news"><a href="#">OA协同办公</a></li>
						            <li class="inactive" id="about"><a href="#">CRM客户管理</a></li>
						            <li class="inactive" id="mars"><a href="#">CMS内容管理</a></li>
						            <li class="inactive" id="jielong"><a href="#">####</a></li>
						            <li class="inactive" id="box"><a href="#">####</a></li>
						            <li class="inactive" id="school"><a href="#">系统管理</a></li>
					    		-->
					        </ul>
					    </div>
					</div>
				</div>
			</header>
			
			<section>
				<div id="left_menu">
					<!-- Menu开始 -->
					<table id="menulist" width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEF2FB">
						<!-- 
						<tr>
					    	<td width="182" valign="top">
						    	<h1><a href="javascript:void(0);" class="MH" lang="1">网站基本管理</a></h1>
						    	<div class="content">
						    		<ul class="menu_ul" id="mlist1">
						    			<li><a href="javascript:void(0);">基本管理1</a></li>
						    			<li><a href="javascript:void(0);">基本管理1</a></li>
						    			<li><a href="javascript:void(0);">基本管理1</a></li>
						    			<li><a href="javascript:void(0);">基本管理1</a></li>
						    		</ul>
						    	</div>
					    	</td>
					   	</tr>
						<tr>
					    	<td width="182" valign="top">
						    	<h1><a href="javascript:void(0);" class="MH" lang="2">网站基本管理</a></h1>
						    	<div class="content">
						    		<ul class="menu_ul" id="mlist2">
						    			<li><a href="javascript:void(0);">基本管理2</a></li>
						    			<li><a href="javascript:void(0);">基本管理2</a></li>
						    			<li><a href="javascript:void(0);">基本管理2</a></li>
						    			<li><a href="javascript:void(0);">基本管理2</a></li>
						    		</ul>
						    	</div>
					    	</td>
					   	</tr>
					   	<tr>
					    	<td width="182" valign="top">
						    	<h1><a href="javascript:void(0);" class="MH" lang="3">网站基本管理</a></h1>
						    	<div class="content">
						    		<ul class="menu_ul" id="mlist3">
						    			<li><a href="javascript:void(0);">基本管理3</a></li>
						    			<li><a href="javascript:void(0);">基本管理3</a></li>
						    			<li><a href="javascript:void(0);">基本管理3</a></li>
						    			<li><a href="javascript:void(0);">基本管理3</a></li>
						    		</ul>
						    	</div>
					    	</td>
					   	</tr>		
						 -->
					 </table>
					 <!-- Menu结束 -->
				</div>
				<div id="right">
					<!-- 
					-->
					<div class="nf">
						<div class="naviName">
							<span class="gg"><img src="${pageContext.request.contextPath}/images/admin/back.gif"></span>
							<span class="nn">导航名称</span>
						</div>
						<div class="function_right" id="fbar">
							<!-- 
							<a hidefocus="hidefocus" href="javascript:void(0);" title="" class="active_bar"><span>当前项目列表</span></a>
							<a hidefocus="hidefocus" href="javascript:void(0);" title="" class="active_bar"><span>当前项目列表</span></a>
							<a hidefocus="hidefocus" href="javascript:void(0);" title="" class="active_bar"><span>当前项目列表</span></a>
							<a hidefocus="hidefocus" href="javascript:void(0);" title="" class="active_bar"><span>当前项目列表</span></a>
							 -->
						</div>
					</div>
					
					<div class="pageframe">
						<iframe name="pageframe" src="${pageContext.request.contextPath}/web_manager/_page/_table.jsp" width="100%" height="100%"></iframe>
					</div>
					
				</div>
			</section>
		
		<script type="text/javascript">
			menuOpar();
		</script>
		</div>
	</body>
</html>
